package ru.ipo.problemsapi;

import java.io.InputStream;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Ilya
 * Date: 23.05.2010
 * Time: 15:51:05
 */
public interface Problem {

    /**
     * Opens a stream to read the entry. Fails with IOError if entry contains String
     * @param name of the resource with data
     * @return stream to read data
     */
    InputStream getReadStream(String name);

    /**
     * Returns entry contents as a String. Fails with IOException if entry contains binary data 
     * @param name name of the resource with string data
     * @return entry as a String
     */
    String getString(String name);

    /**
     * Returns if the entry is only for teachers
     * @param name name to the data
     * @return if the entry is only for teachers
     */
    boolean isTeacher(String name);

    /**
     * List all names from the problem
     * @return list of paths
     */
    List<String> listNames();
}